Skip to content

sp_HealthParser: @warnings_only filters memory broker rows on SHRINK (#941) - #960

Merged
erikdarlingdata merged 2 commits into
devfrom
fix/941-healthparser-broker-warnings
Nov 13, 2026
Merged

erikdarlingdata merged 2 commits into
devfrom
fix/941-healthparser-broker-warnings

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Fixes the @warnings_only = 1 memory broker filter reported in #941. This is a dev merge, so the issue will not close on its own; the coordinator closes it.

What went wrong

In the memory broker section, sp_HealthParser.sql filtered memory_broker_ring_buffer_recorded events with value[.= "RESOURCE_MEMPHYSICAL_LOW"]. That is a resource monitor value (correct in the memory conditions section, which reads @lastNotification). A broker notification is STABLE, GROW or SHRINK. With @warnings_only = 1 no broker row could ever pass, so the proc printed "no memory pressure events found" even when SHRINK events existed.

The fix

With @warnings_only = 1, keep a broker row only when notification is SHRINK. @warnings_only = 0 keeps every row as before. Same expression shape, one string changed:

WHERE (w.x.exist('(data[@name="notification"]/value[.= "SHRINK"])') = @warnings_only OR @warnings_only = 0)

Siblings: notification appears in only one filter in the proc (the broker one). The RESOURCE_MEMPHYSICAL_LOW filter in the memory conditions section is correct and untouched. The README row and the @help text for @warnings_only now say that memory broker rows count as a warning only when the notification is SHRINK. No version or @version_date change.

Proof

1. Predicate proof (synthetic XML with three memory_broker_ring_buffer_recorded events, GROW, STABLE, SHRINK; old and new WHERE predicate; SQL2025):

predicate @warnings_only rows kept notifications
old 0 3 GROW,STABLE,SHRINK
old 1 0 (none)
new 0 3 GROW,STABLE,SHRINK
new 1 1 SHRINK

2. Real run on SQL2025's live system_health (before and after proc installed in a scratch database, since dropped). EXECUTE dbo.sp_HealthParser @what_to_check = 'memory', @start_date = '20200101', @end_date = '20261231', @warnings_only = <0|1>, broker result set rows counted by notification:

proc @warnings_only broker rows by notification
before 0 130,309 GROW 64,488, STABLE 47,085, SHRINK 18,736
before 1 0 "no memory pressure events found ... with @warnings_only set to 1", although 18,736 SHRINK rows exist
after 0 130,682 GROW 64,668, STABLE 47,219, SHRINK 18,795
after 1 18,852 SHRINK 18,852 only; GROW and STABLE absent

This server now holds real SHRINK events (the issue's server had none), so the before run shows the bug directly. The server is live: the after run happened a few minutes later, so its counts are slightly higher than the before run (SHRINK 18,795 in the @warnings_only = 0 run, 18,852 in the = 1 run a minute or two after). The after @warnings_only = 1 run returns every SHRINK row and nothing else.

The edited proc file was also installed and @help = 1 run: it compiles and the new @warnings_only text shows.

Dropped

Nothing.

Considered, not added

  • No test harness exists for sp_HealthParser; none was created (scratch scripts only, outside the repo).
  • No change to the memory conditions filter or to what @warnings_only means in other sections.

Checks

  • Plain-English checker run on the changed README cell: clean.
  • Only sp_HealthParser/sp_HealthParser.sql and sp_HealthParser/README.md changed. Install-All/DarlingData.sql untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M98owc3zzZNEpij3p49Bbe

…941)

The memory broker section tested the broker notification against
RESOURCE_MEMPHYSICAL_LOW, a resource monitor value. A broker notification is
STABLE, GROW or SHRINK, so with @warnings_only = 1 no broker row could ever be
returned, even when SHRINK events existed. Keep a broker row under
@warnings_only = 1 only when the notification is SHRINK. The README row and
@help text now say so. The resource monitor filter in the memory conditions
section is correct and unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M98owc3zzZNEpij3p49Bbe
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review November 13, 2026 13:16
@claude

claude Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Claude finished @erikdarlingdata's task in 10s —— View job


Review

The change is correct. The broker notification values are STABLE, GROW and SHRINK, so filtering on SHRINK fixes the always-empty @warnings_only = 1 result. The predicate keeps the same shape, and @warnings_only = 0 behaves as before. The RESOURCE_MEMPHYSICAL_LOW filter in the memory conditions section is left alone, which is right.

  • Only the proc and the README changed. Install-All/DarlingData.sql is untouched.
  • There is no @version or @version_date bump.
  • There are no new dependencies and no style problems. The diff is one string plus the help and README text.
  • Your before and after runs show the bug and the fix directly.

I have no blocking issues. I could only compare against the last two commits because origin/dev has no merge base in this checkout. I did not run the proc here.

@erikdarlingdata
erikdarlingdata merged commit 23e9dad into dev Nov 13, 2026
7 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/941-healthparser-broker-warnings branch November 13, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant